]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
signalTracker: Add debug function to get all signal trackers
authorSebastian Keller <skeller@gnome.org>
Sat, 11 Apr 2026 13:43:05 +0000 (15:43 +0200)
committerSebastian Keller <skeller@gnome.org>
Sat, 11 Apr 2026 14:51:30 +0000 (16:51 +0200)
Signal trackers have been the source of difficult to identify leaks in
the past. Having access to the list of all active signal trackers at run
time without having to modify and rebuild gnome-shell can be very
valuable in identifying the source of these leaks, especially since the
steps required to trigger a leak might not always be obvious.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6423
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4169>

js/misc/signalTracker.js

index 60991d40428cc4a16ebeec0cdbcb9688a838be35..2a3e2b6c7195576bfbd7f16f24c736a1384dbd31 100644 (file)
@@ -272,3 +272,12 @@ export function registerDestroyableType(gtype) {
 
     destroyableTypes.push(gtype);
 }
+
+/**
+ * A debug function that can be used to inspect signal trackers at run time
+ *
+ * @returns {Map<object, SignalTracker>}
+ */
+export function debugGetSignalTrackers() {
+    return SignalManager.getDefault()._signalTrackers;
+}